﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;

namespace ResourceBlender_Express {
    public static class Constants {
        /// <summary>
        /// Gets the application version.
        /// </summary>
        /// <returns></returns>
        public static Version GetVersion() {
            return System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
        }

        /// <summary>
        /// Gets the date the assembly was compiled.
        /// </summary>
        public static DateTime BuildDate = Utils.RetrieveLinkerTimestamp();

        public const string ResxSkeleton = "<?xml version=\"1.0\" encoding=\"utf-8\"?><root><xsd:schema id=\"root\" xmlns=\"\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:msdata=\"urn:schemas-microsoft-com:xml-msdata\"><xsd:import namespace=\"http://www.w3.org/XML/1998/namespace\" /><xsd:element name=\"root\" msdata:IsDataSet=\"true\"><xsd:complexType><xsd:choice maxOccurs=\"unbounded\"><xsd:element name=\"metadata\"><xsd:complexType><xsd:sequence><xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" /></xsd:sequence><xsd:attribute name=\"name\" use=\"required\" type=\"xsd:string\" /><xsd:attribute name=\"type\" type=\"xsd:string\" /><xsd:attribute name=\"mimetype\" type=\"xsd:string\" /><xsd:attribute ref=\"xml:space\" /></xsd:complexType></xsd:element><xsd:element name=\"assembly\"><xsd:complexType><xsd:attribute name=\"alias\" type=\"xsd:string\" /><xsd:attribute name=\"name\" type=\"xsd:string\" /></xsd:complexType></xsd:element><xsd:element name=\"data\"><xsd:complexType><xsd:sequence><xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" /><xsd:element name=\"comment\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"2\" /></xsd:sequence><xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" msdata:Ordinal=\"1\" /><xsd:attribute name=\"type\" type=\"xsd:string\" msdata:Ordinal=\"3\" /><xsd:attribute name=\"mimetype\" type=\"xsd:string\" msdata:Ordinal=\"4\" /><xsd:attribute ref=\"xml:space\" /></xsd:complexType></xsd:element><xsd:element name=\"resheader\"><xsd:complexType><xsd:sequence><xsd:element name=\"value\" type=\"xsd:string\" minOccurs=\"0\" msdata:Ordinal=\"1\" /></xsd:sequence><xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\" /></xsd:complexType></xsd:element></xsd:choice></xsd:complexType></xsd:element></xsd:schema><resheader name=\"resmimetype\"><value>text/microsoft-resx</value></resheader><resheader name=\"version\"><value>2.0</value></resheader><resheader name=\"reader\"><value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader><resheader name=\"writer\"><value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value></resheader></root>";
        public const string ContentsRDF = @"<?xml version=""1.0""?>
<RDF:RDF xmlns:chrome=""http://www.mozilla.org/rdf/chrome#""
         xmlns:RDF=""http://www.w3.org/1999/02/22-rdf-syntax-ns#"">

    <RDF:Seq about=""urn:mozilla:locale:root"">
        <RDF:li resource=""urn:mozilla:locale:{0}""/>
    </RDF:Seq>

    <RDF:Description about=""urn:mozilla:locale:{0}""
                     chrome:displayName=""{1}({0})""
                     chrome:name=""{0}"">
        <chrome:packages>
            <RDF:Seq about=""urn:mozilla:locale:{0}:packages"">
                <RDF:li resource=""urn:mozilla:locale:{0}:{2}""/>
            </RDF:Seq>
        </chrome:packages>
    </RDF:Description>
</RDF:RDF>"; // {0}=langAbbreviation, {1}=FriendlyName, {2}=ApplicationName

        /// <summary>
        /// Languages supported by Google's Translate API
        /// See http://code.google.com/intl/de/apis/ajaxlanguage/documentation/#SupportedPairs for an updated list
        /// </summary>
        public static Hashtable GoogleSupportedLanguages = new Hashtable(){
            { "ar", "Arabic" },
            { "bg", "Bulgarian" },
            { "ca", "Catalan" },
            { "zh", "Chinese" },
            { "zh-CN", "Chinese (Simplified)" },
            { "zh-TW", "Chinese (Traditional)" },
            { "hr", "Croatian" },
            { "cs", "Czech" },
            { "da", "Danish" },
            { "nl", "Dutch" },
            { "en", "English" },
            { "tl", "Filipino" },
            { "fi", "Finnish" },
            { "fr", "French" },
            { "de", "German" },
            { "el", "Greek" },
            { "iw", "Hebrew" },
            { "hi", "Hindi" },
            { "id", "Indonesian" },
            { "it", "Italian" },
            { "ja", "Japanese" },
            { "ko", "Korean" },
            { "lv", "Latvian" },
            { "lt", "Lithuanian" },
            { "no", "Norwegian" },
            { "pl", "Polish" },
            { "pt-PT", "Portuguese" },
            { "ro", "Romanian" },
            { "ru", "Russian" },
            { "es", "Spanish" },
            { "sr", "Serbian" },
            { "sk", "Slovak" },
            { "sl", "Slovenian" },
            { "sv", "Swedish" },
            { "uk", "Ukranian" },
            { "vi", "Vietnamese"}
        };

        /// <summary>
        /// In-built resource formats
        /// </summary>
        public enum ResourceType {
            Java,
            [EnumBinder.EnumDescription(".NET Framework")]
            DotNet,
            [EnumBinder.EnumDescription(".NET Compact Framework")]
            DotNetCF,
            [EnumBinder.EnumDescription("Firefox XUL/Javascript")]
            Firefox,
            [EnumBinder.EnumDescription("GNU Portable Object (PO)")]
            PO,
        }

        /// <summary>
        /// Import/export data types
        /// </summary>
        public enum DataType {
            XML,
            XMLXLS,
            Properties,
            Resx,
            Firefox,
            PO
        }

        public const string MySQLConnecionString = "Server={0};Port={1};Database={2};User={3};Password={4};";
        public const string SQL2008ConnectionString = "Data Source={0},{1};Initial Catalog={2};User Id={3};Password={4};";
        public const string SQLiteConnectionString = "Data Source={0}";
    }
}
